package ynny.dome02;

import java.sql.Array;
import java.util.ArrayList;

public class StudentText {
    public static void main(String[] args) {
        ArrayList<Student> arrayList = new ArrayList();
        Student student = new Student();
        arrayList.add(new Student("1","张三"));
        arrayList.add(new Student("2","李四"));
        arrayList.add(new Student("3","王五"));

        for (int i = 0; i < arrayList.size(); i++) {

            System.out.println("ID为："+arrayList.get(i).getId()+"\t"+"姓名为："+arrayList.get(i).getName());

        }

        for (int i = 0; i < arrayList.size(); i++) {
            if (arrayList.get(i).getName().equals("张三")){

                arrayList.get(i).setName("张三丰");

            }
        }
        System.out.println("修改张三为张三丰后为："+arrayList);
        for (int i = 0; i < arrayList.size(); i++) {
            if (arrayList.get(i).getName().equals("李四")){

                arrayList.remove(i);

            }

        }
        System.out.println("删除李四后为："+arrayList);
    }
}

    


